package cn.edu.neu.softlab633.influencemaximization.sy.bean.CELF;

import cn.edu.neu.softlab633.influencemaximization.sy.bean.MarginGain;

/**
 * Created by Jason on 2017/5/11.
 */
public class CELFQueueEle implements Comparable<CELFQueueEle> {
    private int id;
    private MarginGain gain;
    private int round;

    public CELFQueueEle() {
    }

    public CELFQueueEle(int id, MarginGain gain, int round) {

        this.id = id;
        this.gain = gain;
        this.round = round;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setGain(MarginGain gain) {
        this.gain = gain;
    }

    public void setRound(int round) {
        this.round = round;
    }

    public int getId() {

        return id;
    }

    public MarginGain getGain() {
        return gain;
    }

    public int getRound() {
        return round;
    }

    @Override
    public int compareTo(CELFQueueEle o) {
        if (this.getId() == o.getId()) {
            return 0;
        } else {
            int tmp = this.getGain().compareTo(o.getGain());
            if (tmp != 0) {
                return -tmp;
            }
            int tt = o.getRound() - this.getRound();
            if (tt != 0) {
                return tt;
            }
            return -1;
        }
    }
}
